import React from 'react';
import { connect } from 'dva';
import ProList from '../components/proList'

const Pro =({dispatch,pro})=>{
  function del(id){
    dispatch({
      type:'pro/del',
      payload:id
    })
  }
  return(
    <div>
      <h2>List of Products</h2>
      <ProList onDelete={del} pro={pro} />
    </div>
  )
}


export default connect(({pro})=>{
  return ({pro})
})(Pro);
